package com.kkd.kkdapp.http.manager;

import java.io.File;
import java.io.FileNotFoundException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.kkd.kkdapp.BaseApplication;
import com.kkd.kkdapp.Environment;
import com.kkd.kkdapp.db.CurUserModel;
import com.kkd.kkdapp.db.app.model.User;
import com.kkd.kkdapp.db.user.KkdDBHelper;
import com.kkd.kkdapp.db.user.model.KkdMessageModel;
import com.kkd.kkdapp.db.user.model.PrivilegeModel;
import com.kkd.kkdapp.db.user.model.UserInfo;
import com.kkd.kkdapp.http.entity.AccountInfoRes;
import com.kkd.kkdapp.http.entity.CreditData;
import com.kkd.kkdapp.http.entity.CurrentTenderSuccessEntity;
import com.kkd.kkdapp.http.entity.InformationData;
import com.kkd.kkdapp.http.entity.InformationDataList;
import com.kkd.kkdapp.http.entity.LogCard;
import com.kkd.kkdapp.http.entity.Login;
import com.kkd.kkdapp.http.entity.LoginData;
import com.kkd.kkdapp.http.entity.PrivilegeData;
import com.kkd.kkdapp.http.entity.Register;
import com.kkd.kkdapp.http.entity.RegisterMessage;
import com.kkd.kkdapp.http.entity.selectedGroup;
import com.kkd.kkdapp.patternlock.PatternLockUtils;
import com.kkd.kkdapp.utils.PreferenceUtils;

public class KkdHttpMagager {

	private static KkdHttpMagager instance;

	public static KkdHttpMagager getInstance() {
		if (instance == null) {
			instance = new KkdHttpMagager();
		}
		return instance;
	}

	// 还款详情
	public void getRepaymentDetailManager(String poiId, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		User user = CurUserModel.getCurUser();
		if (user == null)
			return;
		req.add("poi_id", poiId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bill/poi_income.do", req,
				callback, type);
	}

	public void getBidDetailManager(String poiId, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		User user = CurUserModel.getCurUser();
		if (user == null)
			return;
		req.add("poi_id", poiId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bill/poi_income_detail.do", req,
				callback, type);
	}

	// 投标详情

	// 标的还款计划
	public void getRepaymentScheduleManager(String bid_id, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("bid_id", bid_id);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bill/bill_list.do", req,
				callBack, type);
	}

	// 天天赚主界面
	public void getAccounEverydayManager(Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "queryYuebaoInfo.do", req,
				callBack, type);
	}

	// 绑定银行卡
	public void getAddBankManager(String ticket, String validCode,
			String bindingId, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("ticket", ticket);
		req.add("validCode", validCode);
		req.add("bindingId", bindingId);
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "bindingBankCardAdvance.do", req,
				callBack, type);

	}

	/**
	 * 短信
	 * 
	 * @param mobile
	 *            手机号，必填
	 * @param srvTxCode
	 *            业务交易代码，必填（开户：accountOpenPlus，绑卡：cardBindPlus，修改手机号：
	 *            mobileModifyPlus）
	 * @param type
	 * @param callBack
	 */
	public void getSmsCodeApplyManager(String mobile, String srvTxCode,
			Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("mobile", mobile);
		req.add("srvTxCode", srvTxCode);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "smsCodeApply.do", req, callBack,
				type);
	}

	/**
	 * 实名及其绑定银行卡---开户
	 * 
	 * @param idNo
	 *            身份证号码，必填
	 * @param name
	 *            姓名，必填
	 * @param mobile
	 *            手机号，必填
	 * @param cardNo
	 *            银行卡号，必填
	 * @param lastSrvAuthCode
	 *            前导业务授权码 通过请求发送短信验证码接口获取，必填
	 * @param smsCode
	 *            短信验证码，必填
	 * @param bankCode
	 *            银行编码，必填
	 * @param type
	 * @param callBack
	 */
	public void getAddNameBankManager(String idNo, String name, String mobile,
			String cardNo, String lastSrvAuthCode, String smsCode,
			String bankCode, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("idNo", idNo);
		req.add("name", name);
		req.add("mobile", mobile);
		req.add("cardNo", cardNo);
		req.add("lastSrvAuthCode", lastSrvAuthCode);
		req.add("smsCode", smsCode);
		req.add("bankCode", bankCode);
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "accountOpenPlus.do", req,
				callBack, type);
	}

	/**
	 * 设置交易密码
	 * 
	 * @param type
	 * @param callBack
	 */
	public void getJiangXiPassword(Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "passwordSet.do", req, callBack,
				type);
	}

	// 绑定银行卡并发送验证码
	public void getAddBankVerifitionManager(String bankCode, String cardNo,
			String cellphone, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("bankCode", bankCode);
		req.add("cardNo", cardNo);
		req.add("cellphone", cellphone);
		// req.add("channel", "Android");
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bindingBankCard.do", req,
				callBack, type);
	}

	// 全部已读个人消息
	public void getAllReadPersonMsgManager(Type type, HttpCallBack callBack) {

		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "allReadPersonMsg.do", req,
				callBack, type);
	}

	// 房宝宝
	public void getBabyManager(int pageNO, int pageSize, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/fangbaobao.do", req,
				callBack, type);
	}

	// 投标记录
	public void getConditionManager(int pageNO, int pageSize, String bidId,
			Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("bidId", bidId);
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/bidPoiList.do", req,
				callBack, type);
	}

	// 交易明细
	public void getDealDetailsManager(int pageNow, int pageSize,
			String tradeType, int status, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNow", pageNow);
		req.put("pageSize", pageSize);
		if (!"-1".equals(tradeType)) {
			req.add("tradeType", tradeType);
		}
		if (!"-1".equals(status)) {
			req.put("status", status);
		}
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "getTradeWaterList.do", req,
				callBack, type);

	}

	// 解绑银行卡
	public void getDeleteMyBnkManager(String cardId, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("cardId", cardId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "unBindingBankCard.do", req,
				callBack, type);
	}

	// 昨日收益
	public void getEarningsManager(Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "getEarningsToday.do", req,
				callBack, type);

	}

	// 天天赚交易明细
	public void getEverydayDetailsManager(int pageNow, int pageSize, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNow", pageNow);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "getYuebaoTradeWaterList.do", req,
				callBack, type);

	}

	// 天天赚详情
	public void getEveryDayManager(Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "yuebao.do", req, callBack, type);
	}

	// 天天赚投标
	public void getEveryDayTenderManager(String yuebaoId, long amount,
			Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("bidId", yuebaoId);
		req.put("amount", amount);
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "yuebao/poi.do", req, callBack,
				type);
	}

	public void getEveryDayTenderManager(String yuebaoId, long amount,
			final HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("bidId", yuebaoId);
		req.put("amount", amount);
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "yuebao/poi.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object res) {
						String reString = res.toString();
						try {
							JSONObject json = new JSONObject(reString);
							if (json.getInt("code") == 0) {
								JSONObject jsonObject = json
										.getJSONObject("data");
								CurrentTenderSuccessEntity currentTenderSuccessEntity = new CurrentTenderSuccessEntity();
								currentTenderSuccessEntity
										.setStartInterest(jsonObject
												.getString("startInterest"));
								currentTenderSuccessEntity
										.setIncomeTime(jsonObject
												.getString("incomeTime"));
								callBack.onSuccess(json.getInt("code"),
										currentTenderSuccessEntity);
							} else {
								callBack.onFailure(json.getInt("code"),
										json.getString("desc"));
							}
						} catch (JSONException e) {
							e.printStackTrace();
						}
					}

					@Override
					public void onFailure(int statusCode, String responseBody) {
						callBack.onFailure(statusCode, new String(responseBody));

					}
				}, String.class);
	}

	// 天天赚取现
	public void getEverydayWithdrawManager(long amount, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("amount", amount);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "yuebao/redeem.do", req, callBack,
				type);

	}

	// 天天赚投标记录
	public void getEvetyDayJoinRecordManager(String yuebaoId, int pageNO,
			int pageSize, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("yuebaoId", yuebaoId);
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "queryYuebaoZRTradeWater.do", req,
				callBack, type);
	}

	// 找回支付密码
	public void getFindPasswordManager(String newPayPassword,
			String confirmPayPassword, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("newPayPassword", newPayPassword);
		req.add("confirmPayPassword", confirmPayPassword);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "getBackPayPassword.do", req,
				callBack, type);
	}

	// 查询账户余额

	public void getAccountInfoManager(final Type type,
			final HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		// KkdHttpClient.getInstance().post2Core(
		// "http://116.62.41.167/app/getAccountInfo.do", req,
		// new HttpCallBack() {
		//
		// @Override
		// public void onSuccess(int statusCode, Object responseBody) {
		// // TODO Auto-generated method stub
		// callBack.onSuccess(statusCode, responseBody);
		// }
		//
		// @Override
		// public void onFailure(int statusCode, String desc) {
		// // TODO Auto-generated method stub
		// callBack.onFailure(statusCode, desc);
		// }
		// }, type);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "getAccountInfo.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object responseBody) {
						// TODO Auto-generated method stub
						try {
							if (type == String.class) {
								JSONObject json = new JSONObject(responseBody
										.toString());
								int isOpenAccount = json
										.optInt("isOpenAccount");
								PreferenceUtils.getInstance().setOpenAccount(
										BaseApplication.getInstance(),
										isOpenAccount);
							} else if (type == AccountInfoRes.class) {
								PreferenceUtils.getInstance().setOpenAccount(
										BaseApplication.getInstance(),
										((AccountInfoRes) responseBody)
												.getIsOpenAccount());
							}
						} catch (Exception e) {
							e.printStackTrace();
						}
						callBack.onSuccess(statusCode, responseBody);
					}

					@Override
					public void onFailure(int statusCode, String desc) {
						// TODO Auto-generated method stub
						callBack.onFailure(statusCode, desc);
					}
				}, type);

	}

	// *************************************************分割线*****************************************************

	// 首页

	/**
	 * 待改
	 * 
	 */
	public void getHomeManager(String productType, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("productType", productType);

		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "index.do", req, callBack, type);
	}

	// 登陆
	public void getLoginManager(String userName, String password, Type type,
			final HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("userName", userName);
		req.add("password", password);
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "login.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object res) {
						// TODO Auto-generated method stub
						Login login = (Login) res;

						User user = new User();
						UserInfo userInfo = new UserInfo();
						LoginData data = login.getData();
						int isRealNameAuth = data.getIsRealNameAuth();
						userInfo.isRealNameAuth = isRealNameAuth;
						int isBoundBankCard = data.getIsBoundBankCard();
						userInfo.isBoundBankCard = isBoundBankCard;
						int isBoundPhone = data.getIsBoundPhone();
						userInfo.isBoundPhone = isBoundPhone;
						int signInFlag = data.getSignInFlag();
						userInfo.signInFlag = signInFlag;
						String idCard = data.getIdCard();
						userInfo.idCard = idCard;
						String realName = data.getRealName();
						userInfo.realName = realName;
						String phone = data.getPhone();
						userInfo.mobile = phone;
						String token = login.getToken();
						userInfo.token = token;
						String customerid = login.getCustomerId();
						userInfo.customerId = customerid;
						LogCard logCard = data.getDefaultCard();
						// 银行卡ID
						String cardId = logCard.getCardId();
						userInfo.cardId = cardId;
						PreferenceUtils.getInstance().setCardNo(
								BaseApplication.getInstance(),
								logCard.getCardNo());
						// 登陆状态
						userInfo.state = login.getCode();
						// 风险评估状态
						userInfo.isSurved = login.getData().getAsses()
								.isAssesStatus() ? 0 : -1;
						if (userInfo.isSurved == 0)
							userInfo.isShowedAsses = 0;
						// 风险评估链接
						userInfo.survedUrl = login.getData().getAsses()
								.getAssesUrl();

						// userInfo.pwd = login_pd_ed.getText().toString();
						// //客户端暂时先不记录用户的密码
						KkdDBHelper.init(BaseApplication.getInstance(),
								customerid);
						user.init(userInfo);
						User.insert(user);
						UserInfo.insertOrUpdate(userInfo);
						PreferenceUtils.getInstance().setLogin(
								BaseApplication.getInstance(), login.getCode());
						// 实名认证
						PreferenceUtils.getInstance().setAutonym(
								BaseApplication.getInstance(), isRealNameAuth);
						// 用户ID和客户端手机令牌
						PreferenceUtils.getInstance().setcustomerId(
								BaseApplication.getInstance(), token,
								customerid);
						// 手机号
						PreferenceUtils.getInstance().setPhone(
								BaseApplication.getInstance(), phone);
						// 用户名和身份证号
						PreferenceUtils.getInstance()
								.setIdCardAndRealName(
										BaseApplication.getInstance(), idCard,
										realName);
						// 银行卡绑定
						PreferenceUtils.getInstance().setBoundBankCard(
								BaseApplication.getInstance(), isBoundBankCard);
						// 是否开户
						PreferenceUtils.getInstance().setOpenAccount(
								BaseApplication.getInstance(),
								data.getIsOpenAccount());
						// 签到
						PreferenceUtils.getInstance().setSignInFlag(
								BaseApplication.getInstance(), signInFlag);
						PreferenceUtils.getInstance().setHomeData(
								BaseApplication.getInstance(), "");
						PreferenceUtils.getInstance().setHeadUrl(
								BaseApplication.getInstance(),
								data.getImageUrl());
						callBack.onSuccess(statusCode, res);
						// 新浪UID
						String sinaUid = data.getSinaUid();
						PreferenceUtils.getInstance().setSinaUid(
								BaseApplication.getInstance(), sinaUid);
						// 用户昵称
						String nickname = data.getNickname();
						PreferenceUtils.getInstance().setNickname(
								BaseApplication.getInstance(), nickname);

					}

					@Override
					public void onFailure(int statusCode, String responseBody) {
						callBack.onFailure(statusCode, responseBody);
					}
				}, type);
	}

	// 邀请好友理财奖励列表
	public void getManageAwardManager(int pageNO, int pageSize,
			String friendCustomerId, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		req.add("friendCustomerId", friendCustomerId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "getInviteFinance.do", req,
				callBack, type);

	}

	// 定期宝
	public void getManageManager(long pageNO, long pageSize, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/dingqibao.do", req, callBack,
				type);
	}

	// 查询银行卡列表
	public void getMyBankManager(Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "queryCardBindingList.do", req,
				callBack, type);
	}

	// 优惠券

	public void getMyDiscountManager(String bidId, String couponType,
			String businessType, String nopage, int pageNO, int pageSize,
			int status, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("couponType", couponType);
		req.put("businessType", businessType);
		req.put("nopage", nopage);
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		req.put("status", status);
		req.put("bidId", bidId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "couponList.do", req, callBack,
				type);
	}

	// 账户总资产

	/**
	 * 数据不是仅有code，descent，data3个字段
	 */
	public void getManageManager(final HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "getAllAccountInfo.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object res) {
						// AllAccountInfo aai = (AllAccountInfo) res;
						String responseString = res.toString();
						PreferenceUtils.getInstance().setMyproperty(
								BaseApplication.getInstance(), responseString);
						callBack.onSuccess(statusCode, res);
					}

					@Override
					public void onFailure(int statusCode, String desc) {
						callBack.onFailure(statusCode, desc);
					}
				}, String.class);
	}

	// 邀请（一级）好友列表
	public void getMyRecommendFriendManager(String search, int pageNO,
			int pageSize, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("search", search);
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "invitefriends.do", req, callBack,
				type);

	}

	// 标的详情
	public void getParticularsManager(String bidid, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("bidid", bidid);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/bidDetail.do", req, callBack,
				type);
	}

	// 发送验证码
	public void getPhoneRegisterManager(String vcode, String phone, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("vcode", vcode);
		req.add("phone", phone);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "sendMobileVerificationCode.do",
				req, callBack, type);
	}

	// 校验手机验证码是否正确
	public void getPhoneVerificationCodeManager(String phone,
			String verificationCode, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("phone", phone);
		req.add("verificationCode", verificationCode);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "isMobileVerificationCode.do",
				req, callBack, type);
	}

	// 上传用户头像
	public void getPhtotoUploadManager(String userHeadUrl, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("userHeadUrl", userHeadUrl);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "uploadUserHead.do", req,
				callBack, type);
	}

	// 后台启动时调用HomePage
	public void getQueryHomePageManager(String deviceTokens, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("deviceTokens", deviceTokens);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "queryHomePage.do", req, callBack,
				type);
	}

	// 提交快捷充值

	public void getRechargeManager(String ticket, String orderId,
			String validCode, final Type type, final HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("ticket", ticket);
		req.add("orderId", orderId);
		req.add("validCode", validCode);
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "advanceHostingPay.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object res) {
						try {
							String st = res.toString();
							JSONObject json = new JSONObject(st);
							String arr = json.getJSONObject("data").toString();
							callBack.onSuccess(statusCode, arr);
						} catch (JSONException e) {
							e.printStackTrace();
						}
					}

					@Override
					public void onFailure(int statusCode, String responseBody) {
						callBack.onFailure(statusCode, responseBody);
					}
				}, type);
	}

	// 提交快捷充值

	public void createHostingDepositByOnlineBank(String amount,
			final Type type, final HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("amount", amount);
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl()
						+ "createHostingDepositByOnlineBank.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object res) {
						try {
							String st = res.toString();
							JSONObject json = new JSONObject(st);
							String arr = json.getJSONObject("data").getString(
									"responseContent");
							callBack.onSuccess(statusCode, arr);
						} catch (JSONException e) {
							e.printStackTrace();
						}
					}

					@Override
					public void onFailure(int statusCode, String responseBody) {
						callBack.onFailure(statusCode, responseBody);
					}
				}, type);
	}

	// 创建快捷充值，并发送验证码
	public void getRechargeSendVerifitionManager(String amount, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("amount", amount);
		// req.add("channel", "Android");
		KkdHttpClient.getInstance()
				.post2Core(
						Environment.getServerUrl()
								+ "createHostingDepositByBinding.do", req,
						callBack, type);
	}

	// 注册用户

	/**
	 * 待改
	 */
	public void getRegisterManager(String phone, String password,
			String confirmPassword, String invite, String downloadSource,
			String verificationCode, Type type, final HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("phone", phone);
		req.add("password", password);
		req.add("confirmPassword", confirmPassword);
		req.add("device", "Android");
		req.add("invite", invite);
		req.add("downloadSource", downloadSource);
		req.add("verificationCode", verificationCode);

		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "registerMember2.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object res) {

						Register register = (Register) res;

						User user = new User();
						UserInfo userInfo = new UserInfo();
						RegisterMessage data = register.getData();
						int isRealNameAuth = data.getIsRealNameAuth();
						userInfo.isRealNameAuth = isRealNameAuth;
						int isBoundBankCard = data.getIsBoundBankCard();
						userInfo.isBoundBankCard = isBoundBankCard;
						int isBoundPhone = data.getIsBoundPhone();
						userInfo.isBoundPhone = isBoundPhone;
						String phone = data.getPhone();
						userInfo.mobile = phone;
						String token = register.getToken();
						userInfo.token = token;
						String customerid = register.getCustomerId();
						userInfo.customerId = customerid;

						// 登陆状态
						userInfo.state = 0;

						// 风险评估状态
						userInfo.isSurved = register.getData().getAsses()
								.isAssesStatus() ? 0 : -1;
						if (userInfo.isSurved == 0)
							userInfo.isShowedAsses = 0;
						// 风险评估链接
						userInfo.survedUrl = register.getData().getAsses()
								.getAssesUrl();

						// user.pwd = login_pd_ed.getText().toString();
						// //客户端暂时先不记录用户的密码
						KkdDBHelper.init(BaseApplication.getInstance(),
								customerid);
						user.init(userInfo);
						User.insert(user);
						UserInfo.insertOrUpdate(userInfo);

						// 实名认证
						PreferenceUtils.getInstance().setAutonym(
								BaseApplication.getInstance(), isRealNameAuth);
						// 用户ID和客户端手机令牌
						PreferenceUtils.getInstance().setcustomerId(
								BaseApplication.getInstance(), token,
								customerid);
						// 手机号
						PreferenceUtils.getInstance().setPhone(
								BaseApplication.getInstance(), phone);
						// 银行卡绑定
						PreferenceUtils.getInstance().setBoundBankCard(
								BaseApplication.getInstance(), isBoundBankCard);
						// 是否开户
						PreferenceUtils.getInstance().setOpenAccount(
								BaseApplication.getInstance(), 0);
						// 签到
						PreferenceUtils.getInstance().setSignInFlag(
								BaseApplication.getInstance(), 0);
						// PreferenceUtils.getInstance().setHomeData(
						// BaseApplication.getInstance(), "");
						PreferenceUtils.getInstance().setLogin(
								BaseApplication.getInstance(), 0);
						// 清掉手势密码
						PatternLockUtils.clearPattern(BaseApplication
								.getInstance());
						callBack.onSuccess(statusCode, res);

					}

					@Override
					public void onFailure(int statusCode, String responseBody) {
						callBack.onFailure(statusCode, responseBody);
					}
				}, type);
	}

	// 忘记密码修改（检查校验码）
	public void getResetPswStep1Manager(String phone, String verificationCode,
			Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("phone", phone);
		req.add("verificationCode", verificationCode);

		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "checkVerificationCode.do", req,
				callBack, type);
	}

	// 忘记密码修改
	public void getResetPswStep3Manager(String phone, String newPassword,
			String confirmPassword, String verificationCode, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("phone", phone);
		req.add("newPassword", newPassword);
		req.add("confirmPassword", confirmPassword);
		req.add("verificationCode", verificationCode);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "resetLoginPwd2.do", req,
				callBack, type);

	}

	// 校验信息是否正确
	public void getReviseWithdreawUpdate(String realName, String idCard,
			String valiCode, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("realName", realName);
		req.add("idCard", idCard);
		req.add("valiCode", valiCode);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "checkGetBackPayPassword.do", req,
				callBack, type);
	}

	// 设置支付密码
	public void getSetDealManager(String password, String confirmPassword,
			Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("password", password);
		req.add("confirmPassword", confirmPassword);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "setPayPassword.do", req,
				callBack, type);
	}

	// 签到
	public void getSignManager(Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "signIn.do", req, callBack, type);
	}

	// 通知消息
	public void getSystemNewsManager(int pageNO, int pageSize, Type type,
			final HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "queryNotificationMsgList.do",
				req, new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object responseBody) {
						callBack.onSuccess(statusCode, responseBody);
						InformationData mInformationData = (InformationData) responseBody;
						int pageNo = mInformationData.getPageNO();
						int pageCount = mInformationData.getPageCount();
						if (pageNo > pageCount) {

						} else {
							List<InformationDataList> dataList = mInformationData
									.getDataList();
							for (InformationDataList i : dataList) {
								KkdMessageModel.insert(i);
								// if(KkdMessageModel.insert(i)==KkdMessageModel.CONTAINED)
								// break;
							}
						}

					}

					@Override
					public void onFailure(int statusCode, String desc) {
						// TODO Auto-generated method stub
						callBack.onFailure(statusCode, desc);
					}
				}, type);
	}

	// 个人消息列表
	public void getInformationManager(int pageNO, int pageSize, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "queryPersonMsgList.do", req,
				callBack, type);

	}

	// 投标
	public void getTenderAffirmManager(String ccId, String bidId, int amount,
			Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("ccId", ccId);
		req.add("bidId", bidId);
		req.put("amount", amount);
		// req.add("channel", "Android");
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/poi.do", req, callBack, type);

	}

	// 理财明细
	public void getTenderDetailManager(String bidStatus, long pageNO,
			long pageSize, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();

		req.add("bidStatus", bidStatus);
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		req.put("bidType", "504,502");
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/poiList.do", req, callBack,
				type);
	}

	// 实名认证
	public void getTrueIDVerifyManager(String realName, String cardNo,
			Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("realName", realName);
		req.add("cardNo", cardNo);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "createActivateMember.do", req,
				callBack, type);
	}

	// 邀请（二级）好友列表
	public void getTwoFriendsManager(int pageNO, int pageSize,
			String friendCustomerId, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		req.put("friendCustomerId", friendCustomerId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "inviteTwofriends.do", req,
				callBack, type);
	}

	// 修改登录密码
	public void getUpdateLoginActivity(String oldPassword, String newPassword,
			String confirmPassword, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("oldPassword", oldPassword);
		req.add("newPassword", newPassword);
		req.add("confirmPassword", confirmPassword);
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "modifyLoginPassword.do", req,
				callBack, type);
	}

	// 版本更新
	public void getUpdateManager(int versionId, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("versionId", versionId);
		// req.add("channel", "Android");
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "appUpdate.do", req, callBack,
				type);
	}

	// 查询单条消息
	public void getVerticalInformationManager(String id, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("id", id);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "queryOnePersonMsg.do", req,
				callBack, type);
	}

	// 提现

	public void getWithdrawManager(String ccId, String amount, String password,
			Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("ccId", ccId);
		req.add("amount", amount);
		req.add("password", password);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "enchashment.do", req, callBack,
				type);
	}

	// 提现 发送手机验证码
	public void getWithdrawSendMobileCodeManager(String phone, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("phone", phone);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "sendMobileCode.do", req,
				callBack, type);
	}

	// 判断是否设置支付密码
	public void getWithdrawUpdateManager(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "isSetPayPassword.do", req,
				callback, type);
	}

	public void uploadException(String exStr, Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.add("crashText", exStr);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "crashInfo.do", req, callback,
				type);
	}

	// 我的借款
	public void getCreditManager(long pageNO, long pageSize, Type type,
			final HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "lend/list.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object responseBody) {

						CreditData data = (CreditData) responseBody;
						data.getData();
						callBack.onSuccess(statusCode, responseBody);
					}

					@Override
					public void onFailure(int statusCode, String desc) {

						callBack.onFailure(statusCode, desc);
					}
				}, type);
	}

	// 在借还款详情
	public void getBillList(String bid_id, Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.add("bid_id", bid_id);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bill/stat/bill_list.do", req,
				callback, type);
	}

	// 按期还款
	public void getUnpayBill(String bid_id, String bill_id, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("bid_id", bid_id);
		req.add("bill_id", bill_id);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bill/stat/get_unpay_bill.do",
				req, callBack, type);
	}

	// 按期还款，立即还款
	public void getRepayBill(String bill_id, Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.add("bill_id", bill_id);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bill/repay_bill2.do", req,
				callback, type);
	}

	// 信用宝
	public void getXinYongBao(long pageNO, long pageSize, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/xinyongbao.do", req,
				callback, type);
	}

	// 首页公告
	public void getImpNotice(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "impNotice.do", req, callback,
				type);
	}

	// 快乐币兑换
	public void coinChange(int coinCount, String amount, int type,
			final HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("coinCount", coinCount);// 快乐币数量
		req.put("amount", amount);// 兑换优惠券金额/加息利率
		req.put("type", type);// 优惠券类型
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "coinChange.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object res) {
						String responseString = res.toString();
						try {
							JSONObject mJSONObject = new JSONObject(
									responseString);

							String coinCount = mJSONObject
									.getJSONObject("data").getString(
											"coinCount");
							callback.onSuccess(0, coinCount);

						} catch (JSONException e) {
							e.printStackTrace();
						}

					}

					@Override
					public void onFailure(int statusCode, String responseBody) {
						callback.onFailure(statusCode, responseBody);

					}
				}, String.class);
	}

	// 快乐币兑换记录
	public void coinExchangeRecord(int pageNO, int pageSize, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);// 当前页
		req.put("pageSize", pageSize);// 每页大小
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "coinChangeList.do", req,
				callback, type);
	}

	// 快乐币兑换商店列表
	public void coinShopList(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "coinShopList.do", req, callback,
				type);
	}

	// 过往标的
	public void pastSubject(int pageNO, int pageSize, String productType,
			Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		req.put("productType", productType);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/beforeBidList.do", req,
				callback, type);

	}

	// 查看全部标的
	public void getAllBidList(int pageNO, int pageSize, int productType,
			Type type, HttpCallBack callback) {

		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		req.put("productType", productType);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/bidList.do", req, callback,
				type);

	}

	// 支持银行卡列表
	public void postCard(final Type type, final HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post(
				Environment.getServerUrl() + "getAllBankList.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object res) {
						try {
							String st = res.toString();
							JSONObject json = new JSONObject(st);
							Gson gson = new Gson();
							String arr = json.getString("data");
							callback.onSuccess(statusCode,
									gson.fromJson(arr, type));

						} catch (JSONException e) {
							e.printStackTrace();
						}
					}

					@Override
					public void onFailure(int statusCode, String responseBody) {
						callback.onFailure(statusCode, responseBody);
					}
				}, String.class);

	}

	// 我的特权本金
	public void myExperienceCold(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "myBbinInfo.do", req, callback,
				type);
	}

	// 特权本金明细
	public void ExperienceColdDetail(int pageNO, int pageSize, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "queryBbinTradeList.do", req,
				callback, type);
	}

	// 快乐币明细
	public void HappyColdDetail(int pageNO, int pageSize, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "coinTranList.do", req, callback,
				type);
	}

	// 投标成功活动
	public void tenderAffirmCampaign(String poiId, long amount,
			int productType, HttpCallBack callback, Type type) {
		BaseRequest req = new BaseRequest();
		req.put("amount", amount);
		req.put("productType", productType);
		req.put("poiId", poiId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/poiLucky.do", req, callback,
				type);
	}

	// 用户反馈
	public void addUserFeedback(String feedbackText, ArrayList<String> nFiles,
			Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("feedbackText", feedbackText);
		for (String path : nFiles) {
			try {
				req.put("myFile", new File(path));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "addUserFeedback.do", req,
				callback, type);
	}

	// 发现接口
	public void requestFind2(Type type, HttpCallBack callback) {
		KkdHttpClient.getInstance().get(
				Environment.getServerUrl() + "findAct.do", type, callback);
	}

	// 发现接口
	public void requestFind(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "findAct.do", req, callback, type);
	}

	// 更多活动接口
	public void requestFindMoreAct(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "findMoreAct.do", req, callback,
				type);
	}

	/**
	 * getYuyinRequest:(这里用一句话描述这个方法的作用). <br/>
	 * 
	 * @author askzhao
	 * 
	 *         注册发送语音验证码
	 * 
	 */
	public void getYuyinRequest(String vcode, String phone, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("vcode", vcode);
		req.put("phone", phone);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "sendYuYinCode.do", req, callback,
				type);

	}

	/**
	 * getYuyinRequest2:(这里用一句话描述这个方法的作用). <br/>
	 * 
	 * 重置密码发送语音验证码
	 * 
	 */
	public void getYuyinRequest2(String vcode, String phone, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("vcode", vcode);
		req.put("phone", phone);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "sendYuYinCode2.do", req,
				callback, type);

	}

	/**
	 * getAllConfig:(这里用一句话描述这个方法的作用). <br/>
	 * 
	 * @author askzhao
	 */
	public void getAllConfig(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "allConfig.do", req, callback,
				type);

	}

	public void activityConfig(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "activityConfig.do", req,
				callback, type);
	}

	/***
	 * 
	 * @param nickname
	 * @param type
	 * @param callback
	 * 
	 *            修改用户昵称
	 * 
	 */
	public void updateNickName(String nickname, Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.add("nickname", nickname);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "modifyNickname.do", req,
				callback, type);
	}

	/*******
	 * 我的特权接口
	 ********/
	public void queryPrivilege(final HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "queryPrivilege.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object responseBody) {
						PrivilegeData data = (PrivilegeData) responseBody;
						PrivilegeModel.insertOrUpdate(data);
						callback.onSuccess(statusCode, responseBody);
					}

					@Override
					public void onFailure(int statusCode, String desc) {
						callback.onFailure(statusCode, desc);
					}
				}, PrivilegeData.class);
	}

	/*******
	 * 优质标的
	 ********/
	public void selectedBid(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/jingxuan.do", req, callback,
				type);
	}

	/**********************
	 * 
	 * 我的头像界面,头像列表接口
	 * 
	 **********************/
	public void headList(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "queryMyImage.do", req, callback,
				type);
	}

	/****************
	 * 快乐币兑换头像接口
	 ***************/
	public void headExchange(int coinCount, String imageCode, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("coinCount", coinCount);
		req.put("imageCode", imageCode);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "changeImage.do", req, callback,
				type);
	}

	/****************
	 * 本产品头像设置接口
	 ****************/
	public void headProductSet(String imageCode, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("imageCode", imageCode);
		KkdHttpClient.getInstance()
				.post2Core(Environment.getServerUrl() + "setImage.do", req,
						callback, type);
	}

	/*****************
	 * K计划详情接口
	 *****************/
	public void financialPlanningDetails(String financeId, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.add("financeId", financeId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "financing/financingDetail.do",
				req, callback, type);

	}

	/*****************
	 * K计划记录
	 *****************/
	public void financingRecords(int pageNO, int pageSize, String financeId,
			Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("financeId", financeId);
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "financing/financingRecords.do",
				req, callback, type);
	}

	/*****************
	 * K计划购买接口
	 *****************/
	public void getFinancialPlanningTenderAffirm(String ccId, String financeId,
			int amount, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("ccId", ccId);
		req.add("financeId", financeId);
		req.put("amount", amount);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "financing/poi.do", req, callBack,
				type);

	}

	// 我的K计划
	public void getMyPlanManager(String status, long pageNO, long pageSize,
			Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("status", status);
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "financing/myFinancingRecords.do",
				req, callBack, type);
	}

	// 我的K计划详情页面
	public void getMyPlanDetailManager(String orderId, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("orderId", orderId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl()
						+ "financing/finance_income_detail.do", req, callBack,
				type);
	}

	// 我的K计划债权匹配记录
	public void getMyMatchingRecordManager(String orderId, long pageNO,
			long pageSize, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("orderId", orderId);
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl()
						+ "financing/financingCreditorsMatch.do", req,
				callBack, type);
	}

	/*******
	 * 签到页接口
	 *******/
	public void getSignInPageInterface(Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "haveSignIn.do", req, callBack,
				type);
	}

	/*******
	 * 签到提醒开关接口
	 *******/
	public void updateRemindSatus(int status, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("status", status);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "updateRemindSatus.do", req,
				callBack, type);
	}

	// 投资福利
	public void tenderWelfare(final HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/fuli.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object responseBody) {
						String json = responseBody.toString();
						Gson gson = new Gson();
						callback.onSuccess(statusCode, gson.fromJson(json,
								new TypeToken<List<selectedGroup>>() {
								}.getType()));
					}

					@Override
					public void onFailure(int statusCode, String desc) {
						callback.onFailure(statusCode, desc);

					}
				}, String.class);
	}

	// 分享邀请好友
	public void addCoinMis(Type types, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("type", "2");
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "addCoinMis.do", req, callback,
				types);

	}

	// 签到页 补签数据接口
	public void beforeRepairSignIn(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "beforeRepairSignIn.do", req,
				callback, type);
	}

	// 补签接口
	public void repairSignIn(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "repairSignIn.do", req, callback,
				type);

	}

	// K计划合同列表
	public void financingArgeement(String orderId, long pageNO, long pageSize,
			Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("orderId", orderId);
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "financing/agreementContracts.do",
				req, callback, type);

	}

	// 理财奖励---K计划
	public void friendForFinancingPlan(String friendCustomerId, int pageNO,
			int pageSize, Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		req.add("friendCustomerId", friendCustomerId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "getPlanInviteFinance.do", req,
				callback, type);
	}

	/**
	 * 修改新浪支付密码
	 * 
	 * @param callback
	 */
	public void updateSinaPayPassword(final HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "modifySinaPayPassword.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object responseBody) {
						try {
							JSONObject jsonObject = new JSONObject(
									(String) responseBody);
							String redirectUrl = jsonObject
									.optString("redirectUrl");
							callback.onSuccess(statusCode, redirectUrl);
						} catch (JSONException e) {
							callback.onSuccess(statusCode, responseBody);
						}
					}

					@Override
					public void onFailure(int statusCode, String desc) {
						callback.onFailure(statusCode, desc);
					}
				}, String.class);
	}

	/**
	 * 找回新浪支付密码
	 * 
	 * @param callback
	 */
	public void findSinaPayPassword(final HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "findSinaPayPassword.do", req,
				new HttpCallBack() {

					@Override
					public void onSuccess(int statusCode, Object responseBody) {
						try {
							JSONObject jsonObject = new JSONObject(
									(String) responseBody);
							String redirectUrl = jsonObject
									.optString("redirectUrl");
							callback.onSuccess(statusCode, redirectUrl);
						} catch (JSONException e) {
							callback.onSuccess(statusCode, responseBody);
						}
					}

					@Override
					public void onFailure(int statusCode, String desc) {
						callback.onFailure(statusCode, desc);
					}
				}, String.class);
	}

	/**
	 * 新浪充值成功后请求首充活动接口
	 * 
	 * @param type
	 * @param callback
	 */
	public void rechargeSinaPayActive(Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "afterDeposit.do", req, callback,
				type);
	}

	/**
	 * 直播首页数据
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param type
	 * @param callback
	 */
	public void liveHomeData(long pageNo, long pageSize, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("pageNo", pageNo);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "video/getLiveInfo", req,
				callback, type);
	}

	/**
	 * 直播点赞
	 * 
	 */
	public void doLike(String vid, Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("vid", vid);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "video/doLike", req, callback,
				type);

	}

	/**
	 * 直播取消点赞
	 * 
	 */
	public void undoLike(String vid, Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("vid", vid);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "video/undoLike", req, callback,
				type);

	}

	/**
	 * 直播详情数据
	 */

	public void getLiveDetail(int pageNo, int pageSize, String vid,
			int avatarCnt, Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("vid", vid);
		req.put("pageNo", pageNo);
		req.put("pageSize", pageSize);
		req.put("avatarCnt", avatarCnt);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "video/getLiveDetail", req,
				callback, type);

	}

	/***
	 * 直播分享成功
	 */
	public void getLiveShare(String vid, Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("vid", vid);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "video/doShare", req, callback,
				type);

	}

	public void reportNewImg(String imgId, String type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("imgId", imgId);
		req.put("type", type);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "reportNewImg.do", req, callback,
				String.class);
	}

	/***
	 * 债权列表接口
	 */
	public void getTransList(int pageNO, int pageSize, int productType,
			Type type, HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("pageSize", pageSize);
		req.put("pageNO", pageNO);
		req.put("productType", productType);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "transfer/transList", req,
				callback, type);

	}

	/***
	 * 债券转让详情接口
	 */
	public void BondTransferParticulars(String transferId, Type type,
			HttpCallBack callback) {
		BaseRequest req = new BaseRequest();
		req.put("transferId", transferId);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "transfer/transDetail", req,
				callback, type);
	}

	/*****************
	 * 账户我的定期
	 *****************/
	public void getMyRegularDebtManager(long typeInt, String bidStatus,
			long pageNO, long pageSize, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("bidType", "504,502");
		req.put("pageSize", pageSize);
		req.put("pageNO", pageNO);
		req.add("bidStatus", bidStatus);
		req.put("type", typeInt);

		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bid/poiList.do", req, callBack,
				type);
	}

	/*****************
	 * 发布债权转让接口
	 *****************/
	public void getDebtExchange(String id, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("id", id);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "debt/transInfo.do", req,
				callBack, type);
	}

	/**
	 * 提交发布债权转让接口
	 * 
	 * @param id
	 * @param parts
	 *            转让份数
	 * @param ratio
	 *            转让系数
	 * @param type
	 * @param callBack
	 */
	public void getCommitDebtExchange(String id, String parts, String ratio,
			Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("id", id);
		req.put("parts", parts);
		req.put("ratio", ratio);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "debt/trans.do", req, callBack,
				type);
	}

	/*****************
	 * 撤销债权转让所需数据
	 *****************/
	public void getCancelDebtTransData(String id, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("id", id);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "debt/backoutConfirm.do", req,
				callBack, type);
	}

	/*****************
	 * 撤销债权转让接口
	 *****************/
	public void getCancelDebtTrans(String id, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("id", id);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "debt/backout.do", req, callBack,
				type);
	}

	/***
	 * 债权转让投标接口
	 */

	public void transferTenderAffirm(int parts, String id, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("parts", parts);
		req.put("id", id);
		KkdHttpClient.getInstance()
				.post2Core(Environment.getServerUrl() + "debt/poi.do", req,
						callBack, type);
	}

	/*****************
	 * 账户我的定期详情
	 *****************/
	public void getMyRegularDebtDetailManager(String poi_id, int typeInt,
			String fromType, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.add("poi_id", poi_id);
		req.add("type", typeInt + "");
		req.put("fromType", fromType);

		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bill/poi_income_detail.do", req,
				callBack, type);
	}

	/****
	 * 购买快乐币接口
	 */
	public void buyHappyCoin(long coinCount, long amount, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("coinCount", coinCount);
		req.put("amount", amount);
		// KkdHttpClient.getInstance().post2Core(
		// "http://116.62.41.167/app/buyCoins.do", req, callBack, type);
		KkdHttpClient.getInstance()
				.post2Core(Environment.getServerUrl() + "buyCoins.do", req,
						callBack, type);
	}

	/*****************
	 * 账户我的快乐币
	 *****************/
	public void getMyHappyCoinManager(int pageNO, int pageSize, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "coinTranList.do", req, callBack,
				type);
		// KkdHttpClient.getInstance()
		// .post2Core("http://116.62.41.167/app/coinTranList.do", req,
		// callBack, type);
	}

	/*****************
	 * 债权协议列表页面接口
	 *****************/
	public void getDebtArgeementManager(String transferId, int pageNO,
			int pageSize, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("transferId", transferId);
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "transfer/agreementContracts",
				req, callBack, type);
	}

	/****************
	 * 图形验证码接口
	 ****************/
	public void getGraphicCode(String phone, Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("phone", phone);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "beforeImageVCode.do", req,
				callBack, type);
	}

	/****************
	 * 还款日历主接口
	 ****************/
	public void getCalendarData(Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bill/incomeByMonthAndDay.do",
				req, callBack, type);
	}

	/**
	 * 还款日历列表接口
	 * 
	 * @param pageNO
	 * @param pageSize
	 * @param type
	 * @param callBack
	 */
	public void getCalendarList(int pageNO, int pageSize, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("pageNO", pageNO);
		req.put("pageSize", pageSize);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bill/bills.do", req, callBack,
				type);
	}

	/**
	 * 还款日历当日列表接口
	 */
	public void getCalendarListCurday(String currDate, Type type,
			HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		req.put("currDate", currDate);
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "bill/billsByDay.do", req,
				callBack, type);
	}

	/**************************
	 * 风险评估未完成后退清理数据接口
	 *************************/
	public void emptyRiskData(Type type, HttpCallBack callBack) {
		BaseRequest req = new BaseRequest();
		KkdHttpClient.getInstance().post2Core(
				Environment.getServerUrl() + "backRiskTotal.do", req, callBack,
				type);

	}
	/*
	 * String customerId,//客户id，必填
       String token,//token，必填
       String channel,//渠道，必填（iOS,Android,H5,WEB）
       String amount,//充值金额，必填
	 * 用户充值接口
	 * 
	 * */
//	public void getRechargeData(String customerId,String token,String channel,String amount,Type type,HttpCallBack callBack){
//		BaseRequest req=new BaseRequest();
//		req.put("customerId", customerId);
//		req.put("token", token);
//		req.put("channel", channel);
//		req.put("amount", amount);
//		KkdHttpClient.getInstance().post2Core(Environment.getServerUrl()+"directRecharge.do", req, callBack, type);
//	}
}
